

class IndexServe {

    async type(data = {}, headers = {}) {
        let http = new html()
        let re = await http.get({
            url: config.urlList.type,
            data
        })

        re.result.principal.unshift({
            id: -1,
            page: -1,
            title: "首页"
        })
        re.result.principal.forEach(v => {
            v.content = []
            v.total_page = 0
        });
        re.result.additional.forEach(v => {
            v.content = []
            v.total_page = 0
        });
        http = null
        console.log(re)
        return re
    }
    //机构
    async mechanism(data = {}, headers = {}) {
        let http = new html()
        let re = await http.get({
            url: config.urlList.mechanism,
            data
        })
        http = null
        return re
    }
    //分类详情
    async mechanismList(data, headers = {}) {
        let http = new html()
        let re = await http.get({
            url: config.urlList.classList,
            data
        })
        http = null
        return re
    }

    async allModel(data = {}, headers = {}) {
        let http = new html()
        let re = await http.get({
            url: config.urlList.allModel,
        })
        http = null
        return re
    }
    async index(data = {}, headers = {}) {
        let http = new html()
        let re = await http.get({
            url: config.urlList.index,
        })
        http = null
        return re
    }

    //详情
    async info(data = {}, headers = {}) {
        let http = new html()
        let re = await http.get({
            data,
            url: config.urlList.info,
        })
        http = null
        return re
    }

    //模特详情页
    async  modelList(data = {}, headers = {}) {
        let http = new html()
        let re = await http.get({
            data,
            url: config.urlList.modelList,
        })
        http = null
        return re
    }
    //搜索
    async search(data = {}, headers = {}) {
        let http = new html()
        let re = await http.get({
            data,
            url: config.urlList.search,
        })
        http = null
        return re
    }
}

var indexserve = new IndexServe();